﻿@import "../../core/less/import.less";

.make-row() {
    .ut-clearfix();
}

.make-grid-columns() {

    .col(@index) {
        @item: ~".wf-col-@{index}";
        .col((@index + 1), @item);
    }

    .col(@index, @list) when (@index =< @grid-columns) {
        @item: ~".wf-col-@{index}";
        .col((@index + 1), ~"@{list}, @{item}");
    }

    .col(@index, @list) when (@index > @grid-columns) {
        @{list} {
            position: relative;
            float:left;
            min-height: 1px;
            padding-left: (@grid-gutter-width / 2);
            padding-right: (@grid-gutter-width / 2);
            -moz-box-sizing: border-box;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
        }
    }

    .generate-columns-width(@n, @i: 1) when (@i =< @n) {
        .wf-col-@{i} {
            width: (@i * 100% / @n);
        }

        .generate-columns-width(@n, (@i + 1));
    }
    //生成公共样式
    .col(1);
    //生成col宽度
    .generate-columns-width(@grid-columns);
}
